package com.wuhan.template.module.home.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/5/11 0011.
 */
public class BaoLiaoFragmentAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragments;
    public BaoLiaoFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        if(fragments.size()>0){

        Fragment fragment = fragments.get(position);
        return fragment;
        }
        return null;
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    private String [] title = {"大家的报料","我的报料"};
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
